using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._RasterAnalysisTools._Hydrology
{
    /// <summary>
    /// <para>Flow Distance</para>
    /// <para>Computes, for each cell, the horizontal or vertical component of downslope distance, following the flow paths, to cells on a stream into which they flow. In the case of multiple flow paths, minimum, weighted mean, or maximum flow distance can be computed.</para>
    /// <para>计算每个像元的水平或垂直分量，沿着流道，到它们流入的流中的像元的下坡距离。在多条流路的情况下，可以计算最小、加权平均或最大流程。</para>
    /// </summary>    
    [DisplayName("Flow Distance")]
    public class FlowDistance : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public FlowDistance()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_inputStreamRaster">
        /// <para>Input Stream Raster</para>
        /// <para>The input raster that defines the stream network.</para>
        /// <para>用于定义流网络的输入栅格。</para>
        /// </param>
        /// <param name="_inputSurfaceRaster">
        /// <para>Input Surface Raster</para>
        /// <para>The input raster representing a continuous surface.</para>
        /// <para>表示连续表面的输入栅格。</para>
        /// </param>
        /// <param name="_outputName">
        /// <para>Output Name</para>
        /// <para><xdoc>
        ///   <para>The name of the output flow distance raster service.</para>
        ///   <para>The default name is based on the tool name and the input layer name. If the layer name already exists, you will be prompted to provide another name.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出流距离栅格服务的名称。</para>
        ///   <para>默认名称基于工具名称和输入图层名称。如果图层名称已存在，系统将提示您提供其他名称。</para>
        /// </xdoc></para>
        /// </param>
        public FlowDistance(object _inputStreamRaster, object _inputSurfaceRaster, object _outputName)
        {
            this._inputStreamRaster = _inputStreamRaster;
            this._inputSurfaceRaster = _inputSurfaceRaster;
            this._outputName = _outputName;
        }
        public override string ToolboxName => "Raster Analysis Tools";

        public override string ToolName => "Flow Distance";

        public override string CallName => "ra.FlowDistance";

        public override List<string> AcceptEnvironments => ["cellSize", "extent", "mask", "outputCoordinateSystem", "snapRaster"];

        public override object[] ParameterInfo => [_inputStreamRaster, _inputSurfaceRaster, _outputName, _inputFlowDirectionRaster, _distanceType.GetGPValue(), _flowDirectionType.GetGPValue(), _outputRaster, _statisticsType.GetGPValue()];

        /// <summary>
        /// <para>Input Stream Raster</para>
        /// <para>The input raster that defines the stream network.</para>
        /// <para>用于定义流网络的输入栅格。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Stream Raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _inputStreamRaster { get; set; }


        /// <summary>
        /// <para>Input Surface Raster</para>
        /// <para>The input raster representing a continuous surface.</para>
        /// <para>表示连续表面的输入栅格。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Surface Raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _inputSurfaceRaster { get; set; }


        /// <summary>
        /// <para>Output Name</para>
        /// <para><xdoc>
        ///   <para>The name of the output flow distance raster service.</para>
        ///   <para>The default name is based on the tool name and the input layer name. If the layer name already exists, you will be prompted to provide another name.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出流距离栅格服务的名称。</para>
        ///   <para>默认名称基于工具名称和输入图层名称。如果图层名称已存在，系统将提示您提供其他名称。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Name")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _outputName { get; set; }


        /// <summary>
        /// <para>Input Flow Direction Raster</para>
        /// <para><xdoc>
        ///   <para>The input raster that shows the direction of flow out of each cell.</para>
        ///   <para>When a flow direction raster is provided, the down slope direction(s) will be limited to those defined by the input flow directions.</para>
        ///   <para>The flow direction raster can be created using the D8, MFD, or DINF method. Use the Flow Direction Type parameter to specify the method used when the flow direction raster was created.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>显示流出每个像元的方向的输入栅格。</para>
        ///   <para>提供流向栅格时，下坡方向将限制为输入流向定义的方向。</para>
        ///   <para>可以使用 D8、MFD 或 DINF 方法创建流向栅格。使用流向类型参数指定创建流向栅格时使用的方法。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Flow Direction Raster")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _inputFlowDirectionRaster { get; set; } = null;


        /// <summary>
        /// <para>Distance Type</para>
        /// <para><xdoc>
        ///   <para>The distance type to be calculated.</para>
        ///   <bulletList>
        ///     <bullet_item>Vertical—The flow distance calculations represent the vertical component of minimum flow distance, following the flow path, from each cell in the domain to cell(s) on the stream into which they flow. This is the default.</bullet_item><para/>
        ///     <bullet_item>Horizontal—The flow distance calculations represent the horizontal component of minimum flow distance, following the flow path, from each cell in the domain to cell(s) on the stream into which they flow.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>要计算的距离类型。</para>
        ///   <bulletList>
        ///     <bullet_item>垂直 - 流距离计算表示最小流距离的垂直分量，沿着流路径，从域中的每个像元到它们流入的流中的像元。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>水平 - 流距离计算表示最小流距离的水平分量，沿着流路径，从域中的每个像元到它们流入的流中的像元。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Distance Type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _distanceType_value _distanceType { get; set; } = _distanceType_value._VERTICAL;

        public enum _distanceType_value
        {
            /// <summary>
            /// <para>Vertical</para>
            /// <para>Vertical—The flow distance calculations represent the vertical component of minimum flow distance, following the flow path, from each cell in the domain to cell(s) on the stream into which they flow. This is the default.</para>
            /// <para>垂直 - 流距离计算表示最小流距离的垂直分量，沿着流路径，从域中的每个像元到它们流入的流中的像元。这是默认设置。</para>
            /// </summary>
            [Description("Vertical")]
            [GPEnumValue("VERTICAL")]
            _VERTICAL,

            /// <summary>
            /// <para>Horizontal</para>
            /// <para>Horizontal—The flow distance calculations represent the horizontal component of minimum flow distance, following the flow path, from each cell in the domain to cell(s) on the stream into which they flow.</para>
            /// <para>水平 - 流距离计算表示最小流距离的水平分量，沿着流路径，从域中的每个像元到它们流入的流中的像元。</para>
            /// </summary>
            [Description("Horizontal")]
            [GPEnumValue("HORIZONTAL")]
            _HORIZONTAL,

        }

        /// <summary>
        /// <para>Flow Direction Type</para>
        /// <para><xdoc>
        ///   <para>Specifies the input flow direction raster type.</para>
        ///   <bulletList>
        ///     <bullet_item>D8—The input flow direction raster is of type D8. This is the default.</bullet_item><para/>
        ///     <bullet_item>MFD—The input flow direction raster is of type Multi Flow Direction (MFD).</bullet_item><para/>
        ///     <bullet_item>DINF—The input flow direction raster is of type D-Infinity (DINF).</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定输入流向栅格类型。</para>
        ///   <bulletList>
        ///     <bullet_item>D8 - 输入流向栅格的类型为 D8。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>MFD—输入流向栅格的类型为多流向 （MFD）。</bullet_item><para/>
        ///     <bullet_item>DINF—输入流向栅格的类型为 D-Infinity （DINF）。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Flow Direction Type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _flowDirectionType_value _flowDirectionType { get; set; } = _flowDirectionType_value._D8;

        public enum _flowDirectionType_value
        {
            /// <summary>
            /// <para>D8</para>
            /// <para>D8—The input flow direction raster is of type D8. This is the default.</para>
            /// <para>D8 - 输入流向栅格的类型为 D8。这是默认设置。</para>
            /// </summary>
            [Description("D8")]
            [GPEnumValue("D8")]
            _D8,

            /// <summary>
            /// <para>MFD</para>
            /// <para>MFD—The input flow direction raster is of type Multi Flow Direction (MFD).</para>
            /// <para>MFD—输入流向栅格的类型为多流向 （MFD）。</para>
            /// </summary>
            [Description("MFD")]
            [GPEnumValue("MFD")]
            _MFD,

            /// <summary>
            /// <para>DINF</para>
            /// <para>DINF—The input flow direction raster is of type D-Infinity (DINF).</para>
            /// <para>DINF—输入流向栅格的类型为 D-Infinity （DINF）。</para>
            /// </summary>
            [Description("DINF")]
            [GPEnumValue("DINF")]
            _DINF,

        }

        /// <summary>
        /// <para>Output Raster</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Raster")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _outputRaster { get; set; }


        /// <summary>
        /// <para>Statistics type</para>
        /// <para><xdoc>
        ///   <para>Determines the statistics type used to compute flow distance over multiple flow paths.</para>
        ///   <para>If there exists only a single flow path from each cell to a cell on the stream, all statistics types produce the same result.</para>
        ///   <bulletList>
        ///     <bullet_item>Minimum—Where multiple flow paths exist, minimum flow distance is computed. This is the default.</bullet_item><para/>
        ///     <bullet_item>Weighted Mean—Where multiple flow paths exist, a weighted mean of flow distance is computed. Flow proportion from a cell to its downstream neighboring cells is used as a weight for computing weighted mean.</bullet_item><para/>
        ///     <bullet_item>Maximum—When multiple flow paths exist, maximum flow distance is computed.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>确定用于计算多个流路径上的流距离的统计类型。</para>
        ///   <para>如果从每个像元到流上的像元之间只存在一条流路径，则所有统计信息类型都会生成相同的结果。</para>
        ///   <bulletList>
        ///     <bullet_item>最小值 （Minimum） - 如果存在多个流路，则计算最小流程。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>加权平均值 （Weighted Mean） - 如果存在多条流路，则计算流距离的加权平均值。从像元到其下游相邻像元的流量比例用作计算加权平均值的权重。</bullet_item><para/>
        ///     <bullet_item>最大值 （Maximum） - 当存在多个流路时，将计算最大流程。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Statistics type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _statisticsType_value _statisticsType { get; set; } = _statisticsType_value._MINIMUM;

        public enum _statisticsType_value
        {
            /// <summary>
            /// <para>Minimum</para>
            /// <para>Minimum—Where multiple flow paths exist, minimum flow distance is computed. This is the default.</para>
            /// <para>最小值 （Minimum） - 如果存在多个流路，则计算最小流程。这是默认设置。</para>
            /// </summary>
            [Description("Minimum")]
            [GPEnumValue("MINIMUM")]
            _MINIMUM,

            /// <summary>
            /// <para>Maximum</para>
            /// <para>Maximum—When multiple flow paths exist, maximum flow distance is computed.</para>
            /// <para>最大值 （Maximum） - 当存在多个流路时，将计算最大流程。</para>
            /// </summary>
            [Description("Maximum")]
            [GPEnumValue("MAXIMUM")]
            _MAXIMUM,

            /// <summary>
            /// <para>Weighted Mean</para>
            /// <para>Weighted Mean—Where multiple flow paths exist, a weighted mean of flow distance is computed. Flow proportion from a cell to its downstream neighboring cells is used as a weight for computing weighted mean.</para>
            /// <para>加权平均值 （Weighted Mean） - 如果存在多条流路，则计算流距离的加权平均值。从像元到其下游相邻像元的流量比例用作计算加权平均值的权重。</para>
            /// </summary>
            [Description("Weighted Mean")]
            [GPEnumValue("WEIGHTED_MEAN")]
            _WEIGHTED_MEAN,

        }

        public FlowDistance SetEnv(object cellSize = null, object extent = null, object mask = null, object outputCoordinateSystem = null, object snapRaster = null)
        {
            base.SetEnv(cellSize: cellSize, extent: extent, mask: mask, outputCoordinateSystem: outputCoordinateSystem, snapRaster: snapRaster);
            return this;
        }

    }

}